package shop.local.ui.gui;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.JLabel;

import net.miginfocom.swing.MigLayout;


public class MitarbeiterPanel extends NaviPanel {
	private MainWindow main;
	private boolean massengut = false;
	private MitarbeiterPanel dieses = this;
	/**
	 * Create the panel.
	 */
	public MitarbeiterPanel(MainWindow window) {
		super(window);
		this.main = window;
		setLayout(new MigLayout("", "[grow]", "[][][][][][][][][]"));

		JLabel lblArtikelAnlegen = new JLabel("Artikel anlegen");
		lblArtikelAnlegen.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent m) {
				main.artikelAbfrage(massengut);
			}
		});
		add(lblArtikelAnlegen, "cell 0 1");
		
		JLabel lblArtikelEditieren = new JLabel("Artikel editieren");
		lblArtikelEditieren.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent m) {
				main.gibAlleArtikel();
			}
		});
		add(lblArtikelEditieren, "cell 0 2");

		JLabel lblEreignisseAnzeigen = new JLabel("Ereignisse anzeigen");
		lblEreignisseAnzeigen.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent m) {
				main.ereignisListe();
			}
		});
		add(lblEreignisseAnzeigen, "cell 0 3");
		
		JLabel lblEreignishistorie = new JLabel("Ereignishistorie");
		lblEreignishistorie.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent m) {
				main.gibHistorie();
			}
		});
		add(lblEreignishistorie, "cell 0 4");
		
		JLabel lblKundenEditeren = new JLabel("Kunden editeren");
		lblKundenEditeren.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent m) {
				main.kundenListe();
			}
		});
		add(lblKundenEditeren, "cell 0 5");
		
		JLabel lblMitarbeiterEditeren = new JLabel("Mitarbeiter editeren");
		lblMitarbeiterEditeren.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent m) {
				main.mitarbeiterListe();
			}
		});
		add(lblMitarbeiterEditeren, "cell 0 6");
		JLabel lblDatenSichern = new JLabel("Daten sichern");
		lblDatenSichern.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent m) {
			}
		});
		add(lblDatenSichern, "cell 0 7");
		JLabel lblCSV = new JLabel("CSV Import/Export");
		lblCSV.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent m) {
				main.kontakt();
			}
		});
		add(lblCSV, "cell 0 8");
	}
	
	public void setRueckgabe(boolean b) {
		this.massengut = b;
	}

}
